home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / merge.z / merge
Encoding:
Text File  |  2002-10-03  |  2.3 KB  |  71 lines

  1. MERGE(3I)                                             Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      MMEERRGGEE - Chooses an alternative value according to the value of a mask
  6.  
  7. SSYYNNOOPPSSIISS
  8.      MMEERRGGEE (([TTSSOOUURRCCEE==]_t_s_o_u_r_c_e,, [FFSSOOUURRCCEE==]_f_s_o_u_r_c_e,, [MMAASSKK==]_m_a_s_k))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, IRIX systems
  12.  
  13.      CF90, MIPSpro 7 Fortran 90
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      The MMEERRGGEE intrinsic function can be used for array construction.  It
  20.      chooses an alternative value according to the value of _m_a_s_k.  This
  21.      function accepts the following arguments:
  22.  
  23.      _t_s_o_u_r_c_e   May be of any type
  24.  
  25.      _f_s_o_u_r_c_e   Must be of the same type and type parameters as _t_s_o_u_r_c_e
  26.  
  27.      _m_a_s_k      Must be of type logical
  28.  
  29.      MMEERRGGEE is an elemental function.  The name of this intrinsic cannot be
  30.      passed as an argument.
  31.  
  32. RREETTUURRNN VVAALLUUEESS
  33.      The result has the same type and type parameters as _t_s_o_u_r_c_e.  The
  34.      result is _t_s_o_u_r_c_e if _m_a_s_k is true and _f_s_o_u_r_c_e otherwise.
  35.  
  36. EEXXAAMMPPLLEESS
  37.      Example 1:  Assume that _t_s_o_u_r_c_e, _f_s_o_u_r_c_e, and _m_a_s_k are arrays.  Array
  38.      _t_s_o_u_r_c_e is as follows:
  39.  
  40.         | 1 6 5 |
  41.  
  42.         | 2 4 6 |
  43.  
  44.      Array _f_s_o_u_r_c_e is as follows:
  45.  
  46.         | 0 3 2 |
  47.  
  48.         | 7 4 8 |
  49.  
  50.      Array _m_a_s_k is as follows:
  51.  
  52.         | T F T |
  53.  
  54.         | F F T |
  55.  
  56.      Also assume that the letter TT represents the value true and the letter
  57.      FF represents the value false.  The statement MMEERRGGEE(_t_s_o_u_r_c_e, _f_s_o_u_r_c_e,
  58.      _m_a_s_k) generates the following:
  59.  
  60.         | 1 3 5 |
  61.  
  62.         | 7 4 6 |
  63.  
  64.      Example 2:  The value of MMEERRGGEE((11..00,,00,,00,,kk>>00)) is [1.0] for _k = 5.
  65.  
  66.      Example 3:  The value of MMEERRGGEE((11..00,,00,,00,,kk>>00)) is [0.0] for _k = -2.
  67.  
  68. SSEEEE AALLSSOO
  69.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  70.      man page.
  71.